package com.czr.controller.blog;

import com.czr.entity.BlogCategory;
import com.czr.service.blog.BlogCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Description:
 * Author: czr czr
 * Version: 1.0
 * Create Date Time: 2021/11/17 16:46.
 * Update Date Time:
 *
 * @see
 */
@RestController
public class BlogCategoryController {

    @Autowired
    private BlogCategoryService blogCategoryService;

    @GetMapping("/api/category/load")
    //@ResponseBody
    public List<BlogCategory> blogCategoryList(Model model){
        //model.addAttribute("blogCategoryList", blogCategoryService.findBlogCategoryes());
        // 基于异步
        return blogCategoryService.findBlogCategoryes();
    }

}
